import Cookies from 'js-cookie'

// 储存语法
// Cookies.set(key, value)
// 读取
// Cookies.get(key)
// 删除
// Cookies.remove(key)
const TokenKey = 'vue_admin_template_token'
const TimeKey = 'vue_admin_template_time'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  Cookies.remove(TimeKey)
  return Cookies.remove(TokenKey)
}
export function setTime() {
  const time = Date.now()
  return Cookies.set(TimeKey, time)
}
export function getTime() {
  return Cookies.set(TimeKey)
}

